/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.gac.gacmod.visual;

import java.awt.Color;
import java.awt.Dimension;
import org.gac.gacmod.model.Step;
import org.netbeans.api.visual.border.BorderFactory;

/**
 *
 * @author Tomek
 */
public class AtomicStepWidget extends StepWidgetBase
{

    public AtomicStepWidget(BoxScene scene, Step modelStep)
    {
        super(scene, modelStep);
        _label.setBackground(new Color(207, 243, 255));
        this.setBorder(BorderFactory.createRoundedBorder(5, 5, Color.WHITE,
                Color.LIGHT_GRAY));
        //this.setMaximumSize(new Dimension(120, 35));
        
        
//        this.getActions().addAction(ActionFactory.createMoveAction(new MoveStrategy()
//        {
//
//            public Point locationSuggested(Widget arg0, Point original, Point suggested)
//            {
//                return new Point( 100, 100 );
//            }
//        },
//                new MoveProvider()
//                {
//
//                    public void movementStarted(Widget arg0)
//                    {
//                        throw new UnsupportedOperationException(
//                                "Not supported yet.");
//                    }
//
//                    public void movementFinished(Widget arg0)
//                    {
//                        throw new UnsupportedOperationException(
//                                "Not supported yet.");
//                    }
//
//                    public Point getOriginalLocation(Widget arg0)
//                    {
//                        return arg0.getLocation();
//                    }
//
//                    public void setNewLocation(Widget arg0, Point arg1)
//                    {
//                        arg0.setp
//                    }
//                }));
    }

    @Override
    public void setSelection( boolean selected )
    {

        if( selected )
        {
            this.setBorder(BorderFactory.createRoundedBorder(5, 5, Color.WHITE,
                Color.RED));
        }
        else
            this.setBorder(BorderFactory.createRoundedBorder(5, 5, Color.WHITE,
                Color.LIGHT_GRAY));
    }


}
